function btclickBefore(buttonName){
   if("增加分支" == buttonName){
	    showAddDlg();
	}
	if("删除分支" == buttonName){
	    showDelDlg();
	}
}

function btclickSuccess(buttonName,response) {

}

function btclickFailure(buttonName,response){

}

function showDelDlg() {	
	$("#delDlg").dialog({
		"buttons":[{text:'确定',cls:"red",handler:function(){
							var deldouserid = $("input[name=deldouserid]").val();
							//非空校验
							if (deldouserid == "") {
								$.simpleAlert("[用户帐号]不允许为空","info");
								return;
							}
							awsui.ajax.request({
							    url : "./jd",
							    method : "POST",
							    data : {sid:sid, 
							    		parentProcessinstid:bindid,
							    		parentTaskDefid:"obj_c747c1b955a00001803d9ee07ea01ccc",
										useridstr:deldouserid,
										cmd:"com.whccb.apps.office.document.sw_addsubpro"
							    	   },
							    ok : function(r) {
							    	alert(r.data.backMessage);
									$("#delDlg").dialog("close");
							    },
							    err:function(r){
								    
							    }
							});
							
						}},
						{text:'取消',handler:function(){
							$("#delDlg").dialog("close");
						}}]
	});
}

function showAddDlg() {	
	$("#addDlg").dialog({
		"buttons":[{text:'确定',cls:"blue",handler:function(){
							var adddouserid = $("input[name=adddouserid]").val();
							//非空校验
							if (adddouserid == "") {
								$.simpleAlert("[用户帐号]不允许为空","info");
								return;
							}
							awsui.ajax.request({
							    url : "./jd",
							    method : "POST",
							    data : {sid:sid, 
							    		parentProcessinstid:bindid,
							    		parentTaskDefid:"obj_c747c1b955a00001803d9ee07ea01ccc",
										useridstr:adddouserid,
										cmd:"com.whccb.apps.office.document.sw_delsubpro"
							    	   },
							    ok : function(r) {
							    	alert(r.data.backMessage);
									$("#addDlg").dialog("close");
							    },
							    err:function(r){
								    
							    }
							});
							
						}},
						{text:'取消',handler:function(){
							$("#addDlg").dialog("close");
						}}]
	});
}